package com.diy.sigmund.diyuser.feign.client;

import com.diy.sigmund.diycommon.entity.ResultMsg;
import com.diy.sigmund.diyuser.feign.fallback.FeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author ylm-sigmund
 * @since 2022/11/12 17:20
 */
@FeignClient(value = "diy-order", contextId = "SeataOrderClient", fallbackFactory = FeignFallbackFactory.class)
public interface SeataOrderClient {

    @PostMapping("/order/seataOrder/decreaseInventory")
    ResultMsg decreaseInventory(@RequestParam String commodityId, @RequestParam Integer transactionQuantity);

    @RequestMapping("/order/seataOrder/update")
    ResultMsg update(@RequestParam("orderId") String orderId, @RequestParam("orderStatus") String orderStatus);
}
